﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;

namespace ERP.ERPModels.Production.MasterData
{
    public class Workshop:Entity<int>
    {
        [Required(ErrorMessage = "车间编码不能为空")]
        [StringLength(50, ErrorMessage = "车间编码长度不能超过50个字符")]
        [Column("WorkshopCode")]
        public string WorkshopCode { get; set; }

        [Required(ErrorMessage = "车间名称不能为空")]
        [StringLength(100, ErrorMessage = "车间名称长度不能超过100个字符")]
        [Column("WorkshopName")]
        public string WorkshopName { get; set; }

        [Required(ErrorMessage = "面积不能为空")]
        [Range(0, double.MaxValue, ErrorMessage = "面积必须大于或等于0")]
        [Column("Area")]
        public decimal Area { get; set; } = 0;  // 默认值0

        [StringLength(50, ErrorMessage = "负责人姓名长度不能超过50个字符")]
        [Column("Manager")]
        public string? Manager { get; set; }  // 可空类型

        [Required(ErrorMessage = "启用状态不能为空")]
        [Column("IsActive")]
        public bool IsActive { get; set; } = true;  // 默认值true

        [Column("Remark")]
        public string? Remark { get; set; }  // 可空类型
    }
}
